#!/bin/bash
yum update -y
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm -y
yum --enablerepo=elrepo-kernel install kernel-ml -y
echo 'net.core.default_qdisc=fq' | tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | tee -a /etc/sysctl.conf
rowNumber=`egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'|grep -in elrepo|awk -F: {'print $1'}`
kernelNumber=$[$rowNumber-1]
grub2-set-default $kernelNumber && reboot